package com.sunny.fetch.pojo;

import javax.persistence.*;

@Table(name = "f_index_weight")
public class FIndexWeight {
    @Id
    private Long tid;

    /**
     * 指数代码
     */
    @Column(name = "index_code")
    private String indexCode;

    /**
     * 成分代码
     */
    @Column(name = "con_code")
    private String conCode;

    /**
     * 交易日期
     */
    @Column(name = "trade_date")
    private String tradeDate;

    /**
     * 权重
     */
    private Float weight;

    public FIndexWeight(Long tid, String indexCode, String conCode, String tradeDate, Float weight) {
        this.tid = tid;
        this.indexCode = indexCode;
        this.conCode = conCode;
        this.tradeDate = tradeDate;
        this.weight = weight;
    }

    public FIndexWeight() {
        super();
    }

    /**
     * @return tid
     */
    public Long getTid() {
        return tid;
    }

    /**
     * @param tid
     */
    public void setTid(Long tid) {
        this.tid = tid;
    }

    /**
     * 获取指数代码
     *
     * @return index_code - 指数代码
     */
    public String getIndexCode() {
        return indexCode;
    }

    /**
     * 设置指数代码
     *
     * @param indexCode 指数代码
     */
    public void setIndexCode(String indexCode) {
        this.indexCode = indexCode;
    }

    /**
     * 获取成分代码
     *
     * @return con_code - 成分代码
     */
    public String getConCode() {
        return conCode;
    }

    /**
     * 设置成分代码
     *
     * @param conCode 成分代码
     */
    public void setConCode(String conCode) {
        this.conCode = conCode;
    }

    /**
     * 获取交易日期
     *
     * @return trade_date - 交易日期
     */
    public String getTradeDate() {
        return tradeDate;
    }

    /**
     * 设置交易日期
     *
     * @param tradeDate 交易日期
     */
    public void setTradeDate(String tradeDate) {
        this.tradeDate = tradeDate;
    }

    /**
     * 获取权重
     *
     * @return weight - 权重
     */
    public Float getWeight() {
        return weight;
    }

    /**
     * 设置权重
     *
     * @param weight 权重
     */
    public void setWeight(Float weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", tid=").append(tid);
        sb.append(", indexCode=").append(indexCode);
        sb.append(", conCode=").append(conCode);
        sb.append(", tradeDate=").append(tradeDate);
        sb.append(", weight=").append(weight);
        sb.append("]");
        return sb.toString();
    }
}